'use strict';

/**
 * @ngdoc function
 * @name jgappApp.controller:OpenfileOpenfileCtrl
 * @description
 * # OpenfileOpenfileCtrl
 * Controller of the jgappApp
 */
angular.module('jgappApp')
    .controller('OpenfileOpenfileCtrl', function($sce, $scope, openApi, $routeParams, $window) {
        $scope.trustSrc = function(src) {
            return $sce.trustAsResourceUrl(src);
        }
        $scope.type = $routeParams.type
        if ($routeParams.type == "file") {
            var url = openApi.previewfile + $routeParams.id + ".do";
        } else if ($routeParams.type == "express") {
            var url = "https://m.kuaidi100.com/result.jsp?com=&nu=" + $routeParams.id;
        }
        $scope.someUrl = url
            // window.location.href = url;
        $scope.goback = function() {
            $window.history.back();
        }
    });
